package com.andy.buyu.server.action;

import org.springframework.stereotype.Component;

import com.andy.buyu.server.game.FishGame;
import com.andy.buyu.server.game.GameUser;
import com.andy.buyu.server.socket.GmAction;
import com.andy.buyu.server.socket.MySocketSession;
import com.andy.buyu.server.socket.SendUtil;
import com.andy.buyu.server.socket.codec.DataWrap;
import com.andy.buyu.server.utils.GoConstant;

/**
 * 调节炮台倍率逻辑
 * @author cuiwm
 *
 */
@Component(GmAction.ACTION_PREFIX+GmAction.ACTION_204)
public class Action204 implements IReqAction{

	@Override
	public void doAction(MySocketSession session, DataWrap data) {
		GameUser user = session.getUser();
		int rate = data.getInt();
		
		FishGame game = user.getGame();
		if(game != null && user.getBattery() <= GoConstant.BATTERY_TYPE_1){
			user.setBatteryRate(rate);
			
			SendUtil.send204(user);
		}
		
	}


	
	
	
}
